package ua.org.extjsbuilder.parser.runtime.instructions;

import ua.org.extjsbuilder.parser.IInstruction;
import ua.org.extjsbuilder.parser.JSErrorHandler;
import ua.org.extjsbuilder.parser.JSParser;

abstract class AbstractInstruction implements IInstruction {
	private JSErrorHandler handler;
	
	protected void err(String message,int line){
		getHandler().error(message, line);
	}
	
	protected void warn(String message,int line){
		getHandler().warn(message, line);
	}
	
	protected JSErrorHandler getHandler(){
		if(handler==null){
			handler = JSParser.getParser().getErrorHandler();
		}
		return handler;
	}
}
